# Maintainer: Jonathan Steel <jsteel at archlinux.org>
# Contributor: Bartłomiej Piotrowski
# Contributor: Laszlo Papp <djszapi2@gmail.com>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>

pkgname=pigz
pkgver=2.8
pkgrel=1
pkgdesc='Parallel implementation of the gzip file compressor'
arch=('loong64' 'x86_64')
url='https://www.zlib.net/pigz'
license=('custom')
depends=('zlib')
source=(https://www.zlib.net/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('7d5f35ffc64b562fc4db40aa783f9935')
sha256sums=('eb872b4f0e1f0ebe59c9f7bd8c506c4204893ba6a8492de31df416f0d5170fd0')

build() {
  cd $pkgname-$pkgver

  make
}

package() {
  cd $pkgname-$pkgver

  install -Dm755 "$srcdir"/$pkgname-$pkgver/$pkgname \
    "$pkgdir"/usr/bin/$pkgname 

  pushd "$pkgdir"/usr/bin
    ln -s pigz unpigz 
  popd

  install -Dm644 "$srcdir"/$pkgname-$pkgver/$pkgname.1 \
    "$pkgdir"/usr/share/man/man1/$pkgname.1
  install -Dm644 "$srcdir"/$pkgname-$pkgver/$pkgname.pdf \
    "$pkgdir"/usr/share/doc/$pkgname/$pkgname.pdf
  install -Dm644 "$srcdir"/$pkgname-$pkgver/README \
    "$pkgdir"/usr/share/licenses/$pkgname/README
}
